home *** CD-ROM | disk | FTP | other *** search
/ PC Advisor 2004 February / PC Advisor February 2004.iso / edit / Utilities / Mail-SpamAssassin-2.60 / Mail-SpamAssassin-2.60 / Razor2.patch < prev    next >
Encoding:
Text File  |  2003-09-22  |  2.8 KB  |  78 lines

  1. This information is originally from http://www.ijs.si/software/amavisd/
  2. (Thanks to amavisd-new, Mark Martinec, and Vivek Khera!)
  3.  
  4. If SpamAssassin is running in taint-mode (the default) and is configured to
  5. call Vipul's Razor 2.22 or higher, then Razor2 checks will fail because the
  6. Razor2 code is not quite taint-safe.  The problem is still present in 2.36
  7. and the SpamAssassin developers do not know when or how this will be
  8. addressed so please don't ask us!
  9.  
  10. To apply: cd to the directory /usr/{lib,share}/perl5/.../Razor2 (wherever
  11. the Client subdirectory is located) and apply the patch directly with:
  12.  
  13.   patch -p0 < Razor2.patch
  14.  
  15. or apply to the Razor2 source tree with:
  16.  
  17.   patch -p0 -d lib/Razor2 < Razor2.patch
  18.  
  19. Please make sure that no unpatched copies of Razor are installed on your
  20. system.  Sometimes, there is more than one installed copy.
  21.  
  22. --- Client/Agent.pm~    Tue Nov 19 16:26:05 2002
  23. +++ Client/Agent.pm    Sun Sep 21 23:20:47 2003
  24. @@ -969,6 +969,7 @@
  25.      my @fns;
  26.      if (opendir D,$self->{razorhome}) {
  27.          @fns = map "$self->{razorhome}/$_", grep /^server\.[\S]+\.conf$/, readdir D;
  28. +        @fns = map { /^(\S+)$/, $1 } @fns; # untaint
  29.          closedir D;
  30.      }
  31.      foreach (@fns) {
  32. --- Client/Config.pm~    Thu Nov 14 14:47:01 2002
  33. +++ Client/Config.pm    Sun Sep 21 23:18:52 2003
  34. @@ -323,9 +323,11 @@
  35.          if ($fn =~ /^(.*)\/([^\/]+)$/) {
  36.              my $dir = $1;
  37.              $fn = readlink $fn;
  38. +            $fn = $1 if $fn =~ /^(\S+)$/; # untaint readlink
  39.              $fn = "$dir/$fn" unless $fn =~ /^\//;
  40.          } else {
  41.              $fn = readlink $fn;
  42. +            $fn = $1 if $fn =~ /^(\S+)$/; # untaint readlink
  43.          }
  44.      }
  45.  }
  46. @@ -366,13 +368,13 @@
  47.          chomp; 
  48.          next if /^\s*#/;
  49.          if ($nothash) {
  50. -            s/^\s+//; s/\s+$//;
  51. +            next unless s/^\s*(.+?)\s*$/$1/; # untaint
  52.              $conf->{$_} = 7;
  53.              push @lines, $_;
  54.          } else { 
  55.              next unless /=/;
  56. -            my ($attribute, $value) = split /\=/, $_, 2; 
  57. -            $attribute =~ s/^\s+//; $attribute =~ s/\s+$//;
  58. +            my ($attribute, $value) = /^\s*(.+?)\s*=\s*(.+?)\s*$/; # untaint
  59. +            next unless (defined $attribute && defined $value);
  60.              $conf->{$attribute} = $self->parse_value($value);
  61.          }
  62.          $total++;
  63. --- Client/Core.pm~    Wed Nov 13 12:01:10 2002
  64. +++ Client/Core.pm    Sun Sep 21 23:20:21 2003
  65. @@ -216,8 +216,10 @@
  66.          foreach $rr ($query->answer) { 
  67.              my $pushed = 0;
  68.              if ($rr->type eq "A") { 
  69. -                push @list, $rr->address; 
  70. -                $pushed = 1;
  71. +                if ($rr->address =~ m/^(\d+\.\d+\.\d+\.\d+)$/) {
  72. +                    push @list, $1; 
  73. +                    $pushed = 1;
  74. +                }
  75.              } elsif ($rr->type eq "CNAME") { 
  76.                  if ($rr->cname eq 'list.terminator') { 
  77.                      pop @list if $pushed;
  78.